# def fn(a,n):
#     s = str(a)
#     sum = 0
#     for i in range(n):
#         sum += int(s)
#         s += str(a)
#     return sum
#
# a,b=input().split()
# s=fn(int(a),int(b))
# print(s)

def fn(a, n):
    sum_num = 0
    num = 0
    for i in range(n):
        num = num * 10 + a
        sum_num += num
    return sum_num

a,b=input().split()
s=fn(int(a),int(b))
print(s)